//
//  TFSearchBar.h
//  TestByFF
//
//  Created by hanxifeng on 16/7/1.
//  Copyright © 2016年 haixu. All rights reserved.
//

#import <UIKit/UIKit.h>
@class FSearchBar;
@protocol FSearchBarDelegate <NSObject>
/**
 *  开始输入时触发
 *  @param searchBar searchBar本身
 */
-(void)FSearchBarDidBeginEditing:(FSearchBar *)searchBar;

/**
 *  输入内容有改动就会触发
 *  @param searchBar  searchBar本身
 *  @param textString 改变之后的文本内容
 */
-(void)FSearchBarDidChangeEditing:(FSearchBar *)searchBar withTextString:(NSString *)textString;

/**
 *  取消输入
 *  @param searchBar searchBar本身
 */
-(void)FSearchBarCancleEditing:(FSearchBar *)searchBar;

/**
 *  键盘搜索按钮触发
 *  @param searchBar searchBar本身
 */
-(void)FSearchBarSearchBtnClick:(FSearchBar *)searchBar;

@end

@interface FSearchBar : UIView
@property (nonatomic,strong)UISearchBar *searchBar;
@property (nonatomic,weak)id <FSearchBarDelegate>delegate;
/**
 *  是否显示取消按钮 搜索框上是否带字
 *
 *  @param isShow YES 显示 NO隐藏
 *  @param isWith YES 搜索框上有字   NO无字
 */
-(void)showCancleBtn:(BOOL)isShow withText:(BOOL)isWith;
@end
